
<?php if ($article->can_comment): ?>
    <div class="component_comment">
        <div class="comment_header"><h1><?php echo t('LBL_COMMENT', 'content') ?>:</h1></div>
        <?php foreach ($comment_list as $item): ?>
            <div class="comment_item">
                <ul>
                    <li>
                        <div class="cm-author">
                            <span class="cm-name"><?php echo CHtml::encode($item->created_by) ?></span>
                            <span class="cm-date"> (<?php echo $item->create_date; ?>)</span>
                        </div>
                        <div class="cm-text"><?php echo CHtml::encode($item->comment_text); ?></div>
                    </li>
                </ul>                                
            </div>
        <?php endforeach; ?>    
        <div class="comment_form">
            <h3><?php echo t('LBL_COMMENT_VIEW', 'content') ?></h3>
            <?php if (Yii::app()->user->hasFlash('success')): ?>
                <div class="flash-success">
                    <?php echo Yii::app()->user->getFlash('success'); ?>
                </div>
         <?php elseif (Yii::app()->user->hasFlash('failure')): ?>
                <div class="flash-error">
                    <?php echo Yii::app()->user->getFlash('failure'); ?>
                </div>
            <?php endif; ?>
            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'id' => 'article-form',
                'enableAjaxValidation' => false,
                'enableClientValidation' => true,
                'clientOptions' => array('validateOnSubmit' => true, 'validateOnType' => true),
                    ));
            ?>
            <table style="width: 100%" class="form">
                <tr>
                    <td class="label required" width="100px" ><?php echo t('LBL_COMMENT_SUBMIT_BY', 'content') ?> <span>*</span></td>
                    <td class="input" >
                        <?php echo $form->hiddenField($comment, "article_id", array('value' => $article->id)) ?>
                        <?php echo $form->textField($comment, 'created_by', array('class' => 'txt-created')); ?>
                        <?php echo $form->error($comment, 'created_by'); ?>
                    </td>
                </tr>
                <tr>
                    <td class="label required" width="100px" valign="top"><?php echo t('LBL_COMMENT_TEXT', 'content') ?> <span>*</span></td>
                    <td class="input">
                        <?php echo $form->textArea($comment, 'comment_text', array('rows' => '3', 'class' => 'txt-comment')); ?>
                        <?php echo $form->error($comment, 'comment_text'); ?>
                    </td>
                </tr>                
                <tr>
                    <td></td>
                    <td>
                        <?php echo Html::submitButton(t('BTN_COMMENT_SUBMIT', 'content')); ?>                        
                    </td>
                </tr>
            </table>
            <?php $this->endWidget(); ?>
        </div>
    </div>
<?php endif ?>